<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>阿里妈妈助手</title>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" >
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css">
  </head>
  <body>
    <div class="container">
        <div id="toolbar">
            <button id="export" class="btn btn-default">导出文本</button>
        </div>
        <table id="table"
               data-search="true"
               data-show-refresh="true"
               data-show-toggle="true"
               data-show-columns="true"
               data-show-export="true"
               data-toolbar="#toolbar">
            <thead>
            <tr>
                <th data-field="auctionId">ID</th>
                <th data-field="title">商品名称</th>
                <th data-field="tkCommFee">折扣</th>
                <th data-field="zkPrice">单价</th>
                <th data-field="tkRate">收入比率</th>
                <th data-field="tkCommFee">佣金</th>
                <th data-field="totalNum">月推广量</th>
                <th data-field="totalFee">月支出佣金</th>
                <th data-field="auctionUrl">商品链接</th>
                <th data-field="shopTitle">旺旺名称</th>
                <th data-field="tkMktStatus">高佣</th>

            </tr>
            </thead>
        </table>
    </div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>

    <script src="{{ url_for('static', filename='tableExport.js') }}"></script>
    <script src="//cdn.bootcss.com/bootstrap-table/1.11.1/extensions/export/bootstrap-table-export.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>
    <script>
        $(function () {
            $('#table').bootstrapTable({
                data: {{ data|safe }},
            });
            var $table = $('#table');
            $('#export').click(function () {
            $table.tableExport({
                type: 'txt',
                fileName: 'taobao',
                escape: false,
                ignoreColumn: [0,1,2,3,4,5,6,7,9,10],
                ignoreRow: [0],



            });
          });
        })
    </script>
  </body>
</html>